package com.anyou.mall.order.mapper;

import java.math.BigDecimal;
import java.util.List;

import com.anyou.common.core.domain.entity.SysUser;
import com.anyou.mall.goo.goods.domain.GoodsVo2;
import com.anyou.mall.goo.specs.domain.SpeSpecs;
import com.anyou.mall.index.param.OrderNumParam;
import com.anyou.mall.index.param.UserNumParam;
import com.anyou.mall.index.vo.*;
import com.anyou.mall.order.domain.OrdOrder;
import com.anyou.mall.order.orderServe.vo.OrderPayVo;
import com.anyou.mall.order.param.DriverListParam;
import com.anyou.mall.order.param.OrderDeliveryParam;
import com.anyou.mall.order.vo.*;
import com.anyou.mall.sho.vo.SrVo;
import com.anyou.mall.use.param.UserChildParam;
import com.anyou.mall.use.vo.UserQuerySubordinateVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.security.core.parameters.P;

/**
 * 订单Mapper接口
 *
 * @author ruoyi
 * @date 2022-03-21
 */
public interface OrdOrderMapper extends BaseMapper<OrdOrder>
{
    /**
     * 查询订单
     *
     * @param orderId 订单主键
     * @return 订单
     */
    public OrdOrder selectOrdOrderByOrderId(Long orderId);

    /**
     * 查询订单列表
     *
     * @param ordOrder 订单
     * @return 订单集合
     */
    public List<OrdOrder> selectOrdOrderList(OrdOrder ordOrder);

    /**
     * 新增订单
     *
     * @param ordOrder 订单
     * @return 结果
     */
    public int insertOrdOrder(OrdOrder ordOrder);

    /**
     * 修改订单
     *
     * @param ordOrder 订单
     * @return 结果
     */
    public int updateOrdOrder(OrdOrder ordOrder);

    /**
     * 删除订单
     *
     * @param orderId 订单主键
     * @return 结果
     */
    public int deleteOrdOrderByOrderId(Long orderId);

    /**
     * 批量删除订单
     *
     * @param orderIds 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteOrdOrderByOrderIds(Long[] orderIds);

    /**
     * 订单发货列
     * @param
     * @return
     */
    int orderDelivery(@Param(value = "orderNo") String orderNo,
                      @Param(value = "logisticsId") Long logisticsId,
                      @Param(value = "logisticsNo") String logisticsNo,
                      @Param(value = "contactName") String contactName,
                      @Param(value = "contactPhone") String contactPhone);

    /**
     * 订单明细查询
     * @param orderNo
     * @return
     */
    OrderDetailedVo OrderDetailed(@Param("orderNo")String orderNo);

    /**
     * 订单店铺信息查询
     * @param
     * @return
     */
    ShopInfoVo shopSelect(@Param("orderNo")String orderNo);

    /**
     * 订单商品列表查询
     * @param orderNo
     * @return
     */
    List<OrderGoodsListVo>  OrderGoodsListVo(@Param("orderNo")String orderNo);

    /**
     * 司机详情订单编号
     * @param individualAuditId
     * @return
     */
    List<DriverDetailsOrderVo> DriverDetailsOrderVo(@Param("individualAuditId") Long individualAuditId);
    /**
     * 配送
     * @param ordOrder
     * @return
     */
    List<DriverOrder> deliverOrderList(@Param("driverOrder") DriverOrder ordOrder);

    /**
     * 配送订单详情
     * @param orderId
     * @return
     */
    DriverOrder deliverOrderInfo(@Param("orderId")Long orderId);

    /**
     * 订单商品列表
     * @param orderNo
     * @return
     */
    List<OrderListDetailedVo> OrderListDetailed(String orderNo);

    /**
     * 查订单总金额
     * @param carPartsShopId
     * @return
     */
    BigDecimal getTotalMoney(@Param("carPartsShopId")Long carPartsShopId);
    /**
     * 查售后订单退款总金额
     * @param carPartsShopId
     * @return
     */
    BigDecimal getTuiOrderMoney(@Param("carPartsShopId")Long carPartsShopId);

    List<OrderNumTjVo> orderNumTj(@Param("orderNumParam")OrderNumParam orderNumParam);

    SysUser selectUserById(@Param("userId")Long userId);

    OrderPayVo getOrderPay(@Param("orderPayNo")String orderPayNo);

    /**
     * 商品销售金额折线走势图
     * @param orderNumParam
     * @return
     */
    List<OrderNumTjVo> getTotalMoney2(@Param("orderNumParam") OrderNumParam orderNumParam);
    /**
     * 获取商家总销售额与总销售次数
     * @param userId
     * @return
     */
    SrVo selectSr(@Param("userId") Long userId);

    /**
     * 查询积分订单列表
     * @param ordOrder
     * @return
     */
    List<OrdOrder> selectIntegralOrderList(OrdOrder ordOrder);

    /**
     * 水票订单列表
     * @param ordOrder
     * @return
     */
    List<OrdOrder> selectWaterCouponOrderList(OrdOrder ordOrder);

    /**
     * 提现总金额
     * @return
     */
    BigDecimal selectSumMoney();

    /**
     * 订单中商品类型与商品数量统计
     * @param param
     * @return
     */
    List<OrderTypeAna> selectOtaList(@Param("param") UserNumParam param);

    /**
     * 订单分析环形图
     * @param param
     * @return
     */
    List<OrderTypeAna2> selectAna2(@Param("param")UserNumParam param);

    /**
     * 购水用途饼状图
     * @param param
     * @return
     */
    List<OrderTypeAna2> waterUse(@Param("param")OrderNumParam param);

    /**
     * 查询订单详情
     * @param orderId
     * @return
     */
    OrdOrder selectInfoById(@Param("orderId")Long orderId);

    /**
     * 查询购水用途
     * @param orderId
     * @return
     */
    List<OrderUseVo> selectOrderUseList(@Param("orderId")Long orderId);

    /**
     * 司机列表
     * @param param
     * @return
     */
    List<DriverListVo> driverList(DriverListParam param);

    /**
     * 商品列表
     * @param goodsName
     * @return
     */
    List<GoodsVo2> goodsList(String goodsName);


}
